

//@Bean
class CoinInvestService {

	//@Value(invest.amount_month)
	amount;

	//@Value(invest.coinList)
	coinList;

	//@Value(invest.hearbeat)
	hearbeat;

	//计算购买间隔
	getByInterval(){
		const perAmount = this.coinList.map(v => v.amount).reduce((s,v)=> s+v,0)

		const buyAcountForMonth = this.amount/perAmount;

		return 30*24*60*60*1000/buyAcountForMonth;
	}

}

module.exports = {CoinInvestService}